package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.dto.RewardDto;
import com.zhentao.mapper.RewardTypeMapper;
import com.zhentao.pojo.RewardType;
import com.zhentao.service.RewardTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author hp
* @description 针对表【reward_type】的数据库操作Service实现
* @createDate 2025-07-09 15:20:23
*/
@Service
public class RewardTypeServiceImpl extends ServiceImpl<RewardTypeMapper, RewardType>
    implements RewardTypeService{
    @Autowired
    private RewardTypeMapper rewardTypeMapper;
    @Override
    public Page<RewardType> findRewardType(RewardDto dto) {
        Page<RewardType> page = new Page<>(dto.getCurrent(),dto.getSize());
        QueryWrapper<RewardType> wrapper = new QueryWrapper<>();
        wrapper.like(dto.getRewardName()!=null,"reward_name",dto.getRewardName());
        rewardTypeMapper.selectPage(page,wrapper);
        return page;
    }
}




